<div class="frame_addfactoryDiv">
	<div class="pmflDiv">
		<li><a class="currentAuction_all" href="adminb-auction-winauction?type=all">&nbsp;A l l&nbsp;</a></li>
		<li><a class="currentAuction_paid" href="adminb-auction-winauction?type=paid">Has paid</a></li>
		<li><a class="currentAuction_notpaid" href="adminb-auction-winauction?type=notpaid">Not yet paid</a></li>
		<li style="margin-left:20px"><a class="currentAuction_add" href="adminb-recharge-index">Recharge Account</a></li>
	</div>
	<div class="clear"></div>
	<br />
  <form name="buyerContactForm" id="buyerContactForm" action="adminb-auction-docontact" method="post">
  <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#c8d9e9">
    <tr>
      <th colspan="2" width="20%" class="ri-bbgg" style="text-align:center;padding:10px;font-size:18px;background-color:#ffffff">
	  	Fill in the address where you are
	  </th>
    </tr>
	<tr>
      <td width="20%" class="ri-bbgg">Country：</td>
      <td width="80%" class="le">
		<select name="location_id">
			<option value="0">select area</option>
			<?for($i=0;$i<count($this->fenleiArray);$i++):?>
			<option value="<?=$this->fenleiArray[$i]['flid']?>"><?=$this->fenleiArray[$i]['en_flname']?></option>
			<?endfor;?>
		</select><input type="hidden" value="<?=$this->contactArray[0]['location_id']?>" name="flid" id="flid" />
	  </td>
    </tr>
	<tr>
      <td width="20%" class="ri-bbgg">City：</td>
      <td width="80%" class="le">
		<div><input name="city" type="text" value="<?=$this->contactArray[0]['city']?>" /></div>
	  </td>
    </tr>
	<tr>
      <td width="20%" class="ri-bbgg">Address：</td>
      <td width="80%" class="le">
	  	<div class="buyAddress">
			<?foreach($this->addressArray as $value):?>
				<div><input type="radio" name="addressid" value="<?=$value['addressid']?>" /><span><?=$value['content']?></span></div>
			<?endforeach;?>
			<div><input type="radio" name="addressid" value="0" /><input class="addressInput" type="text" value="" name="address" /></div>
		</div>
	  </td>
    </tr>
	
	
	<tr>
      <td width="20%" class="ri-bbgg">Company Name：</td>
      <td width="80%" class="le">
		<div><input name="company_name" type="text" value="<?=$this->contactArray[0]['company_name']?>" /></div>
	  </td>
    </tr>
	<tr>
      <td width="20%" class="ri-bbgg">Contact Name：</td>
      <td width="80%" class="le">
		<div><input name="contact_name" type="text" value="<?=$this->contactArray[0]['contact_name']?>" /></div>
	  </td>
    </tr>
	<tr>
      <td width="20%" class="ri-bbgg">Postal Code：</td>
      <td width="80%" class="le">
		<div><input name="code" type="text" value="<?=$this->contactArray[0]['code']?>" /></div>
	  </td>
    </tr>
	<tr>
      <td width="20%" class="ri-bbgg">Phone Number：</td>
      <td width="80%" class="le">
		<div><input name="phone_number" type="text" value="<?=$this->contactArray[0]['phone_number']?>" /></div>
	  </td>
    </tr>
	<tr>
      <td width="20%" class="ri-bbgg">Fax Number：</td>
      <td width="80%" class="le">
		<div><input name="fax_number" type="text" value="<?=$this->contactArray[0]['fax_number']?>" /></div>
	  </td>
    </tr>

	
	
	<tr>
      <th colspan="2" width="20%" class="ri-bbgg" style="text-align:center;padding:10px;font-size:18px;background-color:#ffffff">
	  	<input type="button" value="Back" onclick="window.location.href='adminb-auction-winauction?type=notpaid'" />&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" onclick="checkForm()" value="Next" />
	  </th>
    </tr>
  </table>
  </form>
</div>
<script>
$('select[name="location_id"]').val("<?=$this->contactArray[0]['location_id']?>");
$($('.buyAddress input').get(0)).attr('checked',true);
$('input[name="addressid"]').each(
	function(){
		if($(this).next().html()=='<?=$this->contactArray[0]['address']?>'){
			$(this).attr('checked',true);
		}
	}
);
function checkForm(){
	var locationid=$('select[name="location_id"]').val();
	if(locationid==''||locationid==0){
		alert("Please select your country!");
		return false;
	}
	if(trim($('input[name="city"]').val())==''){
		alert("Please input your city!");
		return false;
	}
	if($('input[name="address"]').prev().attr('checked')==true){
		if(trim($('input[name="address"]').val())==''){
			alert("Please input your address!");
			return false;
		}
	}
	$('#buyerContactForm').submit();
}
</script>